package com.mijie.homi.ns.dao;

import java.util.HashMap;

import org.springframework.stereotype.Repository;

import com.mijie.core.IBatisDao;
import com.mijie.homi.common.domain.user.Friend;
import com.mijie.homi.common.util.HomiUtil;

@Repository
public class FriendDao extends IBatisDao {

	public int updateLastContactDetail(Friend friend){
		HashMap<String,Object> parameter = new HashMap<String,Object>();
		parameter.put("tableName", HomiUtil.getFriendTableName(friend.getUserId()));
		parameter.put("moodForFriendOfLastContact", friend.getMoodForFriendOfLastContact());
		parameter.put("moodForMinedOfLastContact", friend.getMoodForMinedOfLastContact());
		parameter.put("lastContactAt", friend.getLastContactAt());
		parameter.put("userId", friend.getUserId());
		parameter.put("friendId", friend.getFriendId());
		return this.update("updateLastContactDetail", parameter);
	}
}
